<?php

/**
 * Reservation form base class.
 *
 * @method Reservation getObject() Returns the current form's model object
 *
 * @package    tfe
 * @subpackage form
 * @author     3emeIG
 * @version    SVN: $Id: sfDoctrineFormGeneratedInheritanceTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseReservationForm extends InscriptionForm
{
  protected function setupInheritance()
  {
    parent::setupInheritance();

    $this->widgetSchema   ['id_evenement'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Evenement'), 'add_empty' => false));
    $this->validatorSchema['id_evenement'] = new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Evenement')));

    $this->widgetSchema   ['nb_pers'] = new sfWidgetFormInputText();
    $this->validatorSchema['nb_pers'] = new sfValidatorInteger();

    $this->widgetSchema   ['reduction'] = new sfWidgetFormInputText();
    $this->validatorSchema['reduction'] = new sfValidatorNumber(array('required' => false));

    $this->widgetSchema   ['a_envoyer'] = new sfWidgetFormInputCheckbox();
    $this->validatorSchema['a_envoyer'] = new sfValidatorBoolean(array('required' => false));

    $this->widgetSchema   ['envoyee'] = new sfWidgetFormInputCheckbox();
    $this->validatorSchema['envoyee'] = new sfValidatorBoolean(array('required' => false));

    $this->widgetSchema->setNameFormat('reservation[%s]');
  }

  public function getModelName()
  {
    return 'Reservation';
  }

}
